Scoping Constructs in Logic Programming: Implementation Problems and their Solutions

نویسندگان

  • Gopalan Nadathur
  • Bharat Jayaraman
  • Keehang Kwon
چکیده

The inclusion of universal quantification and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quantifiers are permitted to appear in mixed order in goals, the devices of logic variables and unification that are employed in solving existential goals must be modified to ensure that constraints arising out of the order of quantification are respected. Suitable modifications that are based on attaching numerical tags to constants and variables and on using these tags in unification are described. The resulting devices are amenable to an efficient implementation and can, in fact, be assimilated easily into the usual machinery of the Warren Abstract Machine (WAM). The provision of implications in goals results in the possibility of program clauses being added to the program for the purpose of solving specific subgoals. A naive scheme based on asserting and retracting program clauses does not suffice for implementing such additions for two reasons. First, it is necessary to also support the resurrection of an earlier existing program in the face of backtracking. Second, the possibility for implication goals to be surrounded by quantifiers requires a consideration of the parameterization of program clauses by bindings for their free variables. Devices for supporting these additional requirements are described as also is the integration of these devices into the WAM. Further extensions to the machine are outlined for handling higher-order additions to the language. The ideas presented here are relevant to the implementation of the higher-order logic programming language λProlog.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Scoping Constructs in Logic Programming: Implementation Problems and Their Solution Scoping Constructs in Logic Programming: Implementation Problems and Their Solution

The inclusion of universal quanti cation and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quanti ers are permitted to appear in mixed order in goals, the devices of logic variables and uni cation that are employed in solving existential goals ...

متن کامل

Scoping Constructs in Logic Programming : Implementation Problems and their

This paper examines the implementation issues arising from introducing universally quantiied goals and some forms of implication goals in a logic programming language. While these constructs are useful in providing a logical approach to lexical scoping, they raise new implementation problems. Since universal and existential quantiiers may appear in mixed order in goals, the uniication operation...

متن کامل

Scoping Constructs for Program Generators

Program generation is the process of generating code in a high-level language (e.g., C, C++, Java) to implement an abstract specification of a program. Generated programs are created by synthesizing and composing code fragments. Binding identifiers in generated code with their correct variable declarations has been the focus of a lot of research work in the context of macro-expansion (e.g., hyg...

متن کامل

Scoping Constructs for Software Generators

A well-known problem in program generation is scoping. When identifiers (i.e., symbolic names) are used to refer to variables, types, or functions, program generators must ensure that generated identifiers are bound to their intended declarations. This is the standard scoping issue in programming languages, only automatically generated programs can quickly become too complex and maintaining bin...

متن کامل

Representing Objects in a Logic Programming Language With Scoping Constructs

We present a logic programming language that uses implications and universal quantifiers in goals and in the bodies of clauses to provide a simple scoping mechanism for program clauses and constants. Within this language it is possible to define a simple notion of parametric module and local constant. Given this ability to structure programs, we explore how object-oriented programming, where ob...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • J. Log. Program.

دوره 25  شماره 

صفحات  -

تاریخ انتشار 1995